<?php

declare(strict_types=1);

namespace App\Controller\store;

use App\Middleware\User\StoreMiddleware;
use App\Service\Store\IntegralService;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;
use Hyperf\HttpServer\Annotation\Middleware;

/**
 * 积分管理(非审核)
 * @AutoController()
 * @Middleware(StoreMiddleware::class)
 * @author 陈奕文
 * @package App\Controller\store
 */
class IntegralController extends Controller
{

    /**
     * @Inject()
     * @var IntegralService
     */
    private $integral_service;

    /**
     * 积分搜索
     */
    public function search()
    {
        $params = $this->request->all();
        // 获取用户积分列表
        $user_list = $this->integral_service->getIntegralList($params);
        $this->success($user_list);
    }

    /**
     * 积分详情
     */
    public function detail()
    {
        $params = $this->request->all();
        // 获得积分详情
        $integral_list = $this->integral_service->getDetails($params);
        $this->success($integral_list);
    }

}
